package br.ita.comp.ces22.quiz.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@Entity
@Table(name ="user")
@NamedQueries({
		@NamedQuery(name="User.findById", 
				query = "SELECT u FROM user u WHERE u.id = :id"),
		@NamedQuery(name="User.findAll",
				query = "SELECT * FROM user")
})	

public class User extends Observer implements Serializable{
	static final long serialVersionUID = 1L;
	
	@Id
	@Column(name="login")
	private String login;
	
	@Column(name="password")
	private String password;
	
	@Column(name="nome")
	private String name;
	
	@Column(name="email")
	private String email;
	
	@Column(name="admin")
	private Integer admin;
	
	@Column(name="observer")
	private Integer observer;
	
	
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getLogin() {
		return login;
	}
	public void setLogin(String login) {
		this.login = login;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password=password;
	}
	public Integer getAdmin() {
		return admin;
	}
	public void setAdmin(Integer admin) {
		this.admin = admin;
	}
	public Integer getObserver() {
		return observer;
	}
	public void setObserver(Integer observer) {
		this.observer = observer;
	}
}
